import 'package:base_flutter/base_flutter.dart';
import 'package:base_package_init/net/common_apis.dart';

import '../net/response/bed/bed_info_data.dart';

class CustomerModel extends BaseMvvmModel{
  @override
  void onCleared() {
  }

  ///床位基本信息
  Future<BedInfoData> bedInfo(String bedId) async {
    var map = {"bedId": bedId};
    var data = await HttpGo.instance
        .postData(CommonApis.bedInfo, data: map, options: urlHead);
    if ("0" == data['code'].toString()) {
      var bedInfo = BedInfoData.fromJson(data['data']);
      if(bedInfo.checkInElderInfoBean==null){
        throw "该床位为空床";
      }else{
        return bedInfo;
      }
    }else{
      throw data['msg'];
    }
  }
}